load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "raft",
    srcs = [
        "bootstrap.go",
        "doc.go",
        "log.go",
        "log_unstable.go",
        "logger.go",
        "node.go",
        "raft.go",
        "rawnode.go",
        "status.go",
        "storage.go",
        "types.go",
        "util.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/raft",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/raft/confchange",
        "//pkg/raft/quorum",
        "//pkg/raft/raftpb",
        "//pkg/raft/raftstoreliveness",
        "//pkg/raft/tracker",
        "//pkg/util/hlc",
    ],
)

go_test(
    name = "raft_test",
    srcs = [
        "diff_test.go",
        "example_test.go",
        "interaction_test.go",
        "log_test.go",
        "log_unstable_test.go",
        "node_bench_test.go",
        "node_test.go",
        "node_util_test.go",
        "raft_flow_control_test.go",
        "raft_paper_test.go",
        "raft_snap_test.go",
        "raft_test.go",
        "rawnode_test.go",
        "storage_test.go",
        "types_test.go",
        "util_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":raft"],
    deps = [
        "//pkg/raft/quorum",
        "//pkg/raft/raftpb",
        "//pkg/raft/raftstoreliveness",
        "//pkg/raft/rafttest",
        "//pkg/raft/tracker",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_exp//constraints",
    ],
)
